﻿import QtQuick 2.0
import QtQuick.Window 2.12
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14

import "../animation"

Rectangle {
    width: parent.width
    height: parent.height
    radius: 12
    property int listnum: 0
    property int onid: 1  // 当前选中实验（实验名称点击）
    property int onnum: 1  // 当前选中步骤数
    property int onisdef: 1  // 当前选中是否默认
    property bool xzfl: false //当前选中是否展开
    property var sylist: CExeConfig.readsypzlist("")
    signal refr();
    signal fmref();
    //    minimumHeight: 860*dp
    //    minimumWidth: 1430*dp
    //    maximumHeight: 860*dp
    //    maximumWidth: 1430*dp
    property var coorX: []      // 当前按钮坐标（每次拖动实时刷新）
    property var coorY: []
    property var originX: [10*dp, 170*dp, 330*dp, 490*dp, 650*dp, 10*dp, 170*dp, 330*dp]
    property var originY: [50*dp, 50*dp, 50*dp, 50*dp, 50*dp, 100*dp, 100*dp, 100*dp]
    property var onDrag: [false, false, false, false, false, false, false, false]  // 9个
    property real dragX: 0      // 拖动的坐标
    property real dragY: 0
    property real biasX: 0      // 临时坐标，记录鼠标和按钮的偏移量
    property real biasY: 0
    property int num: 8
    property int enterindex: -1  // 进入实验流程索引
    property var dragStartX: 0  // 临时记录 点击开始的坐标
    property var dragStartY: 0
    property bool isPressed: false  // 临时记录 鼠标是否处于按下状态
    property bool isupda: false
    property var fmlist: ["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
    property string fmlistinfo: ""
    Connections{
        target: CSignal
        onSendSyringRunMsg:{
            if(status==="0"){
                if(serial==="7"){
                    toast.show("转盘执行完成",0)
                }
                else if(serial!="8")
                {
                    toast.show(serial+"号注射器执行完成",0)
                    zsqfw.enabled=true
                }
            }
            else if(status==="1"){
                if(serial==="7"){
                    toast.show("转盘正在执行中,请耐心等待",1)
                }
                else if(serial!="8")
                {
                    toast.show(serial+"号注射器正在执行中,请耐心等待",1)
                }
            }
        }
        onSendResetMsg:{
            if(status==="0"){
                if(serial==="7"){
                    toast.show("转盘复位完成",0)
                }
                else{
                    toast.show(serial+"号注射器复位完成",0)
                    zsqtz.enabled=true
                    zsqzx.enabled=true
                }
            }
            else if(status==="1"){
                if(serial==="7"){
                    toast.show("转盘正在复位,请耐心等待",1)
                }
                else if(serial==="0")
                {
                    toast.show("复位动作暂未完成,请耐心等待",1)
                }
                else{
                    toast.show(serial+"号注射器复位未完成,请耐心等待",1)
                }
            }
        }
        onSyringDataLack:{
            toast.show("注射器参数数据缺失,请补充完整",1)
        }
    }
    Connections{
        onFmref:{
            var kfmnub = 0;
            for (var i = 0; i < fmlist.length; i++) {
                if (fmlist[i] === "1") {
                    kfmnub++;
                }
            }
            // 计算阀门关的数量
            var closedValves = 15 - kfmnub;
            // 更新 fminfo 的文本内容
            fminfo.text = "阀门开数量: " + kfmnub + "             阀门关数量: " + closedValves;
        }
    }

    //    function updateLayout(){
    //        myColumnLayout.layoutChildren()
    //    }

    onVisibleChanged: {
        //        zsqls.model=CExeConfig.getzsqdef()
        //        zpgls.model=CExeConfig.getggdef()
        isupda=false
        sytype.model=CExeConfig.gethclxdef()
        updateCoor()
    }
    Timer{      // 救不了了，我也不知道为啥这个坐标计算总不触发
        running: parent.visible
        interval: 800
        repeat: true
        onTriggered: {
            updateCoor()
        }
    }

    function updateCoor(){
        coorX = []
        coorY = []
        for(let i = 0; i < num; i ++){
            if(onDrag[i]){
                coorX.push(dragX - biasX)
                coorY.push(dragY - biasY)
            }else{
                coorX.push(originX[i])
                coorY.push(originY[i])
            }
        }
        for(let i = 0; i < num; i ++){
            buttonList.children[i].x = coorX[i]
            buttonList.children[i].y = coorY[i]

            if(onDrag[i]){
                buttonList.children[i].z = 1
            }else{
                buttonList.children[i].z = 0
            }
        }
        coorXChanged()
        coorYChanged()
    }

    Component.onCompleted: {
        updateCoor()
    }

    BoxWarning{
        id: deflc
        bt1vis: false
        box_text: "默认流程不可删除！"
    }

    // 模拟数据
    ListModel {
        id: myModel
        ListElement { label: "1"; index: 0 }
        ListElement { label: "2"; index: 1 }
        ListElement { label: "3"; index: 2 }
        ListElement { label: "4"; index: 3 }
        ListElement { label: "5"; index: 4 }
        ListElement { label: "6"; index: 5 }
        ListElement { label: "7"; index: 6 }
        ListElement { label: "8"; index: 7 }
        ListElement { label: "9"; index: 8 }
        ListElement { label: "10"; index: 9 }
        ListElement { label: "11"; index: 10 }
        ListElement { label: "12"; index: 11 }
        ListElement { label: "13"; index: 12 }
        ListElement { label: "14"; index: 13 }
    }
    color: "white"
    //    title: "实验配置"

    Connections{  // qmlre
        target: CExeConfig
        onAddlist:{
            sylist=CExeConfig.readsypzlist(synamess.getText())
        }
    }
    Connections{  // qmlre
        target: CExeConfig
        onUpdatatab:{
            sylist=CExeConfig.readsypzlist(synamess.getText())
        }
    }
    Connections{  // qmlre
        target: CExeConfig
        onDellist:{
            sylist=CExeConfig.readsypzlist(synamess.getText())
        }
    }
    Connections{  // qmlre
        target: CExeConfig
        onUplist:{
            sylist=CExeConfig.readsypzlist(synamess.getText())
        }
    }
    Connections{  // qmlre
        target: CExeConfig
        onSave:{
            toast.show("保存成功",0)
        }
    }
    Connections{
        target: CExeConfig
        onRename:{
            toast2.show("实验名称不允许重复",1)
        }
    }

    Toast{
        id: toast
        y: 200*dp
        x: parent.width / 2 - 150*dp
        z: 1
    }
    Toast{
        id: toast2
        y: 200*dp
        x: parent.width / 2 - 150*dp
        z: 1
    }
    Rectangle{
        x:10*dp
        y:10*dp
        width: parent.width-20*dp
        height: parent.height-20*dp
        color: "white"
        Rectangle{
            x: 20*dp
            y: 10*dp
            Text {
                id: tit
                text: qsTr("实验配置")
                font.bold: true
                font.pixelSize: config.fontsize + 5*dp
            }
        }
        // 按钮区域 ======================================================
        Rectangle{
            z:100
            id: buttonList
            x: 20*dp
            y: 40*dp
            width: parent.width*0.70
            height: 150*dp
            color: "#F7F7FA"
            onHeightChanged: {
                updateCoor()
            }onWidthChanged: {
                updateCoor()
            }

            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_zsq.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#00417E"
                text_color: "white"
                title: "注射器"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[0] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[0]){
                        onDrag[0] = false
                        console.log("目标现坐标x",mousePos.x,"目标现坐标y",mousePos.y,onid-1)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            console.log(xzfl)
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,1);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_fm.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#5BA58C"
                text_color: "white"
                title: "阀门"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[1] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[1]){
                        onDrag[1] = false
                        console.log("目标现坐标x",mousePos.x,"目标现坐标y",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,2);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_zp.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#735BA5"
                text_color: "white"
                title: "转盘"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[2] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[2]){
                        onDrag[2] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,3);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/gg.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#9B7E47"
                text_color: "white"
                title: "盖盖"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[3] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[3]){
                        onDrag[3] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,8);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_jc.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#5B66A4"
                text_color: "white"
                title: "检测器"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[4] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[4]){
                        onDrag[4] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,4);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_dd.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#FFB1D8"
                text_color: "white"
                title: "等待"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[5] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[5]){
                        onDrag[5] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,5);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_xh.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#F0ABFF"
                text_color: "white"
                title: "循环"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[6] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[6]){
                        onDrag[6] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,6);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            IPushButton{
                width: 140*dp
                height: 32*dp
                button_icon: "qrc:/picture/pz_tg.png"
                button_icons: "qrc:/picture/pz_tz.png"
                icon_width: 24*dp
                icon_height: 24*dp
                button_color: "#F3B46F"
                text_color: "white"
                title: "跳过"
                onPressed: {
                    isPressed = true
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragStartX = mousePos.x
                    dragStartY = mousePos.y
                    var biasPos = mapToItem(this, mouseX, mouseY)
                    biasX = biasPos.x
                    biasY = biasPos.y
                    updateCoor()
                }
                onPositionChanged: {
                    if(!isPressed) return
                    var mousePos = mapToItem(buttonList, mouseX, mouseY)
                    dragX = mousePos.x
                    dragY = mousePos.y
                    if(dragStartX!=dragX || dragStartY!=dragY){     // 检测到位移，触发拖动
                        onDrag[7] = true
                    }
                    updateCoor()

                }
                onReleased: {
                    isPressed = false

                    var mousePos = mapToItem(sypzmod.itemAt(onid-1), mouseX, mouseY)
                    if(onDrag[7]){
                        onDrag[7] = false
                        console.log("目标现坐标",mousePos.y)
                        if(onid-1>=0&&mousePos.x>0&&mousePos.x<250&&mousePos.y>66){
                            if(xzfl){
                                CExeConfig.addkjchange(onid,mousePos.y,7);
                            }
                        }
                        //                                    console.log(mouseY)
                    }else{
                        //                        console.log("触发点击事件"+index)
                    }
                    updateCoor()
                }
            }
            Rectangle{
                x: 10*dp
                y: 10*dp
                height: 30*dp
                width: parent.width-10*dp
                color: "#F7F7FA"
                Text {
                    text: qsTr("拖拽以下元素到下方菜单中编辑实验流程")
                    font.pixelSize: config.fontsize
                    color: "#999999"
                }
            }
        }
        // 示意图区域 ========================================================
        Rectangle{
            z:0
            width: parent.width*0.25
            height: buttonList.height+30*dp
            x: parent.width*0.73
            y: 10*dp
            border.color: "#B8B7B5"
            color: "#E0E6E9"
            radius: 8
            Image {
                id: pic1
                source: "qrc:/picture/pz_pic.png"
                fillMode: Image.PreserveAspectFit
                width: parent.width
                height: parent.height
            }
            Rectangle{
                x:20*dp
                y:10*dp
                Text {
                    text: qsTr("实验模拟")
                    font.bold: true
                    font.pixelSize: config.fontsize + 3*dp
                }
            }
            AnimationSimulationBox{
                id: animationSimulationBox
            }
            Image{
                anchors.centerIn: parent
                source: "qrc:/picture/video_play2.png"
            }
            MouseArea{
                anchors.fill: parent
                cursorShape: Qt.PointingHandCursor
                onClicked: {
                    //                    animationSimulationBox.show()
                }
            }

            //            PushButton{
            //                id:quanping
            //                x:parent.width-35*dp
            //                y:10*dp
            //                width: 25*dp
            //                height: 25*dp
            //                icon_height: 25*dp
            //                icon_width: 25*dp
            //                button_icon:"qrc:/picture/x_qp.png"
            //                button_color: "transparent"
            //            }
        }
        // 下面的区域 =========================================================
        Rectangle{
            z:0
            x:20*dp
            y:buttonList.height+50*dp
            width: parent.width-40*dp
            height: parent.height-buttonList.height-70*dp
            radius: 12
            border.color: "#B8B7B5"
            clip: true
            PushButton{
                x:20*dp
                y:10*dp
                button_icon: "qrc:/picture/pz_xj.png"
                title: "新建"
                width: 60*dp
                height: 38*dp
                text_color: "#1677FF"
                button_color: isHover?"#ededed":"transparent"
                icon_height: 20*dp
                icon_width: 20*dp
                onReleased: {
                    CExeConfig.newsypz()
                }
            }
            CustomButton{
                x:85*dp
                y:10*dp
                button_icon: "qrc:/picture/pz_dr.png"
                title: "导入"
                width: 60*dp
                height: 38*dp
                text_color: "#1677FF"
                text_color_hover: "#1677FF"
                text_color_press: "#1677FF"
                button_color: isHovered?"#ededed":"transparent"
                icon_size: 20*dp
                CustomTooltip{
                    visible: parent.isHovered
                    text: "点击导入实验"
                }
                onReleased: {
                    var data= CExeConfig.importExeConfig()
                    if(data===0){
                        toast.show("导入成功",0)
                    }
                    else if(data===-1){
                        toast.show("文件不存在",1)
                    }
                    else if(data===-2){
                        toast.show("导入文件数据格式不正确",1)
                    }
                    sylist=CExeConfig.readsypzlist(synamess.getText())
                }
            }
            CustomButton{
                x:150*dp
                y:10*dp
                button_icon: "qrc:/picture/pz_dc.png"
                title: "导出"
                width: 60*dp
                height: 38*dp
                text_color: "#1677FF"
                text_color_hover: "#1677FF"
                text_color_press: "#1677FF"
                button_color: isHovered?"#ededed":"transparent"
                icon_size: 20*dp
                CustomTooltip{
                    visible: parent.isHovered
                    text: "选中实验点击导出"
                }
                onReleased: {
                    var data= CExeConfig.exportExeConfig(onid.toString())
                    if(data===0){
                        toast.show("导出成功",0)
                    }
                    else if(data===-1){
                        toast.show("文件不存在",1)
                    }
                    else if(data===-2){
                        toast.show("导出失败",1)
                    }


                }
            }
            CustomInputText{
                id:synamess
                y:50*dp
                x:10*dp
                editHeight: 30*dp
                editWidth:260*dp
                prompt: "实验名称搜索"
                clearAllButton: true
                textLeftPadding: 36*dp
                inputMaxLength: 15
                onTextChanged: {
                    sylist=CExeConfig.readsypzlist(synamess.getText())
                    myColumnLayout.forceLayout()
                }
                Image {
                    x:5*dp; y: 5*dp
                    width: 20*dp
                    height: 20*dp
                    z:100
                    source: "qrc:/picture/pz_ss.png"
                }
//                CustomButton {
//                    x:parent.width-25*dp
//                    width: 20*dp
//                    height: 20*dp
//                    z:100
//                    anchors.verticalCenter: parent.verticalCenter
//                    button_icon: isHovered?"qrc:/picture/pz_qc2.png":"qrc:/picture/pz_qc.png"
//                    onReleased: {
//                        synamess.setText("")
//                    }
//                }
            }


            Rectangle{
                id:sypzxx
                x:10*dp
                y:100*dp
                width: 260*dp
                height: parent.height-110*dp
                ScrollView {
                    x:0*dp
                    y:0*dp
                    width: 260*dp
                    height: parent.height-60*dp
                    clip: true
                    Column{
                        id:myColumnLayout
                        width: 260*dp
                        height: parent.height
                        spacing: 10*dp
                        Repeater{
                            id:sypzmod
                            model: sylist
                            delegate: Item {
                                x:3*dp
                                width: parent.width
                                height: kjmod.height
                                SYPZModel {
                                    id:kjmod
                                    //                                    height: 25*dp
                                    //                                    anchors.fill: parent
                                    syid: modelData.syid
                                    titlev: modelData.syname
                                    onEntersy: {
                                        enterindex=sylcnum-1
                                        onisdef = btfl3
                                    }
                                    onDelonnub: {
                                        if(btfl3===1){
                                            deflc.show()
                                        }else{
                                            CExeConfig.delsypz(syid)
                                        }
                                    }

                                    onClickcccc: {
                                        xzfl = iszk
                                        onid = syid
                                        console.log(xzfl,onid)
                                        onisdef = btfl3
                                        if(!(titleval==="实验信息"||titleval==="芯片孔位")){
                                            onnum = Number(numval)
                                        }
                                        //                                    onnum = numval
                                        var alda = CExeConfig.readall(onid,onnum)
                                        if(titleval==="实验信息"||titleval==="芯片孔位"){
                                            xjsyxx.visible=true
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                        }else if(titleval==="注射器"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=true
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            zsqbh.setText(alda[0])
                                            zsqys.curColor=alda[1]
                                            zsqls.setText(alda[2])
                                            zsqdz.setText(alda[3])
                                            zsqtj.setText(alda[4])
                                            zsqjl.setText(alda[5])
                                            zsqpc.setText(alda[6])
                                            zsqsd.setText(alda[7])
                                            zsqdw.setText(alda[8])
                                        }else if(titleval==="阀门"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=true
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            //                                            fmk.setText(alda[0])
                                            //                                            fmg.setText(alda[1])
                                            fmlist=["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
                                            fmlistinfo=""
                                            var fmread = alda[1].split(",")

                                            for(var i=0;i<fmread.length;i++){
                                                fmlist[Number(fmread[i])-1]="1"
                                            }
                                            fmbtim1.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim2.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim3.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim4.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim5.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim6.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim7.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim8.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim9.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim10.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim11.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim12.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim13.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim14.source="qrc:/picture/valveButton/bcg_r1.png"
                                            fmbtim15.source="qrc:/picture/valveButton/bcg_r1.png"
                                            if(fmlist[0]==="1"){
                                                fmbtim1.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[1]==="1"){
                                                fmbtim2.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[2]==="1"){
                                                fmbtim3.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[3]==="1"){
                                                fmbtim4.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[4]==="1"){
                                                fmbtim5.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[5]==="1"){
                                                fmbtim6.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[6]==="1"){
                                                fmbtim7.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[6]==="1"){
                                                fmbtim7.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[7]==="1"){
                                                fmbtim8.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[8]==="1"){
                                                fmbtim9.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[9]==="1"){
                                                fmbtim10.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[10]==="1"){
                                                fmbtim11.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[11]==="1"){
                                                fmbtim12.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[12]==="1"){
                                                fmbtim13.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[13]==="1"){
                                                fmbtim14.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            if(fmlist[14]==="1"){
                                                fmbtim15.source="qrc:/picture/valveButton/bcg_g1.png"
                                            }
                                            fmref()
                                        }else if(titleval==="转盘"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=true
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            zpwz.setText(alda[0])
                                            zpsd.setText(alda[1])
                                        }else if(titleval==="等待"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=true
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            yssc.setText(alda[0])
                                        }else if(titleval==="检测器"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=true
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            jctype.setText(alda[0])
                                            jczt.setText(alda[1])
                                            jclmd.setText(alda[2])
                                        }else if(titleval==="循环"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=true
                                            tgtab.visible=false
                                            ggtab.visible=false
                                            xhqsbh.setText(alda[0])
                                            xhzzbh.setText(alda[1])
                                            xhcs.setText(alda[2])
                                        }else if(titleval==="跳过"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=true
                                            ggtab.visible=false
                                            tgbzs.setText(alda[0])
                                        }else if(titleval==="盖盖"){
                                            xjsyxx.visible=false
                                            zsqtab.visible=false
                                            fmtab.visible=false
                                            zptab.visible=false
                                            ystab.visible=false
                                            jctab.visible=false
                                            xhtab.visible=false
                                            tgtab.visible=false
                                            ggtab.visible=true
                                            console.log(alda[0],alda[1])
                                            zpgg.setText(alda[0])
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            Rectangle{
                x:280*dp
                y:0*dp
                width: 1*dp
                height: parent.height
                color: "#B8B7B5"
                z:10
            }

            Rectangle{
                id:xjsyxx
                visible: true
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        id:xyxxbt
                        text: qsTr("实验信息")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.wsyxx(onid,syname.getText(),sytype.getText(),hcpic.source)
                        toast.show("保存成功", 0)
                    }
                }
                CustomInputText{
                    id:syname
                    x:parent.width/4-180*dp
                    y:100*dp
                    title: "实验名称"
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 100*dp
                    defaultText: CExeConfig.rsyxx(onid)
                    inputMaxLength: 20
                    onTextChanged: {
                        sytype.setText(CExeConfig.rsyty(onid))
                    }
                }
                CustomComboBox{
                    id:sytype
                    x:parent.width/4*3-180*dp
                    y:100*dp
                    title: "耗材名称"
                    height: 40*dp
                    editWidth: 220*dp
                    titleWidth: 100*dp
                    model: CExeConfig.gethclxdef()
                    editDefaultText: CExeConfig.rsyty(onid)
                    onCurrentText: {
                        //                        syname.model=GetMessageInterface.getExperimentNameByConsumables(text)
                    }
                }
                Rectangle{
                    x:40*dp
                    y:180*dp
                    width: parent.width-80*dp
                    height: parent.height-210*dp
                    Image {
                        id: hcpic
                        source: "qrc:/picture/pz_xp1.png"
                        fillMode: Image.PreserveAspectFit
                        width: parent.width
                        height: parent.height
                    }
                    Text {
                        //                        x:160*dp
                        y:parent.height-60*dp
                        height: 30*dp
                        id: info
                        text: qsTr("注射器数量: 7            阀门数量: 15            排液针数量:4")
                        width: parent.width*0.6
                        anchors.horizontalCenter: parent.horizontalCenter
                        horizontalAlignment: Text.AlignHCenter
                        font.pixelSize: config.fontsize + 2*dp
                        onWidthChanged: {
                            font.pixelSize = 12*dp + width *0.01
                        }
                    }
                }
            }
            Rectangle{
                id:zsqtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        id:ttype
                        text: qsTr("注射器")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                CustomButton{
                    id:zsqzx
                    x:parent.width-600*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "执行"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        if(zsqbh.getText()===""||zsqls.getText()===""||zsqdz.getText()===""||zsqtj.getText()===""||zsqjl===""||zsqsd===""){
                            toast.show("请确认参数是否填写完整",1)
                        }else{
                            CommunicationMethod.stepOperatingSimulation(1,[sytype.getText(),zsqbh.getText(),zsqys.getColor(),zsqls.getText(),
                                                                           zsqdz.getText(),zsqtj.getText(),
                                                                           zsqjl.getText(),zsqpc.getText(),zsqsd.getText(),zsqdw.getText()])
                            //                            toast.show("保存成功",0)
                            zsqfw.enabled=false
                        }


                    }
                }
                CustomButton{
                    id:zsqtz
                    x:parent.width-480*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "停止"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        CMaintenance.singleStop(zsqbh.getText())
                    }
                }
                PushButton{
                    x:parent.width-360*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        zsqbh.setText("1")
                        zsqls.setText("")
                        zsqdz.setText("")
                        zsqys.curColor=""
                        zsqtj.setText("")
                        zsqjl.setText("")
                        zsqpc.setText("")
                        zsqsd.setText("")
                    }
                }
                CustomButton{
                    id:zsqfw
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "复位"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        CMaintenance.reset("1",zsqbh.getText(),sytype.getText())
                        zsqtz.enabled=false
                        zsqzx.enabled=false
                    }
                }
                PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        if(zsqbh.getText()===""||zsqls.getText()===""||zsqdz.getText()===""||zsqtj.getText()===""||zsqjl===""||zsqsd===""){
                            toast.show("请确认参数是否填写完整",1)
                        }else{
                            CExeConfig.upall(onid,onnum,zsqbh.getText(),zsqys.getColor(),zsqls.getText(),zsqdz.getText(),
                                             zsqtj.getText(),zsqjl.getText(),zsqpc.getText(),zsqsd.getText(),zsqdw.getText())
                            toast.show("保存成功", 0)
                            CAnimation.updateColor(expConfigName.getText())     // JNN-注射器保存后主页注射器颜色跟随变化
                        }
                    }
                }
                CustomComboBox{
                    id:zsqbh
                    x:parent.width/4-180*dp
                    y:100*dp
                    title: qsTr("<font color='red'>*</font>编号")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    model: ["1","2","3","4","5","6"]
                    onCurrentText: {
                        zsqls.setText(CExeConfig.getSyringType(sytype.getText(),text))
                    }
                }
                CustomComboColorPicker{
                    id:zsqys
                    x:parent.width/4*3-200*dp
                    y:100*dp
                    title: "溶液颜色"
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
                CustomComboBox{
                    id:zsqls
                    x:parent.width/4-180*dp
                    y:160*dp
                    title: qsTr("<font color='red'>*</font>注射器类型")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    enabled: false
                    model: CExeConfig.getzsqdef()
                }
                CustomComboBox{
                    id:zsqdz
                    x:parent.width/4*3-200*dp
                    y:160*dp
                    title: qsTr("<font color='red'>*</font>动作")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    model: ["打液","吸液"]
                }
                CustomInputText{
                    id:zsqtj
                    x:parent.width/4-180*dp
                    y:220*dp
                    title: qsTr("<font color='red'>*</font>体积(ml)")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    onTextChanged: {
                        console.log(isupda+"1")
                        if(!isupda){
                            isupda=true
                            zsqjl.setText(CExeConfig.getDistance(sytype.getText(),zsqbh.getText(),zsqtj.getText(),zsqpc.getText()))
                            isupda=false
                        }
                    }
                }
                CustomInputText{
                    id:zsqsd
                    x:parent.width/4*3-200*dp
                    y:220*dp
                    title: qsTr("<font color='red'>*</font>速度")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 120*dp
                    titleWidth: 140*dp
                }
                CustomComboBox{
                    id:zsqdw
                    x:parent.width/4*3+70*dp
                    y:220*dp
                    width: 130*dp
                    height: 40*dp
                    editWidth: 130*dp
                    titleWidth: 0*dp
                    model: ["mL/Min","mm/s"]
                    onCurrentText: {
                        if(text==="mL/Min"){

                        }else{

                        }
                        zsqsd.setText(GetMessageInterface.unitConversionBySerial(zsqsd.getText(),sytype.getText(),zsqbh.getText(),zsqdw.getText()))
                    }
                }
                CustomInputText{
                    id:zsqjl
                    x:parent.width/4-180*dp
                    y:280*dp
                    title: qsTr("<font color='red'>*</font>吸打液距离(mm)")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    defaultText:"自动计算"
                    onTextChanged: {
                        console.log(isupda+"2")
                        if(!isupda){
                            isupda=true
                            zsqtj.setText(CExeConfig.getVolume(sytype.getText(),zsqbh.getText(),zsqjl.getText(),zsqpc.getText()))
                            isupda=false
                        }
                    }
                }
                CustomInputText{
                    id:zsqpc
                    x:parent.width/4*3-200*dp
                    y:280*dp
                    title: "位置偏差(mm)"
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:fmtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("阀门")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-360*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "执行"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        fmlistinfo=""
                        for (var i = 0; i < fmlist.length; i++) {
                            if (fmlist[i] === "1") {
                                if (fmlistinfo.length > 0) {
                                    fmlistinfo += ",";
                                }
                                fmlistinfo += (i + 1).toString();
                            }
                        }
                        CommunicationMethod.stepOperatingSimulation(2,["开启",fmlistinfo])
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        fmlist=["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]
                        fmbtim1.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim2.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim3.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim4.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim5.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim6.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim7.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim8.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim9.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim10.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim11.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim12.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim13.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim14.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmbtim15.source="qrc:/picture/valveButton/bcg_r1.png"
                        fmref()
                    }
                }
                PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        fmlistinfo=""
                        for (var i = 0; i < fmlist.length; i++) {
                            if (fmlist[i] === "1") {
                                if (fmlistinfo.length > 0) {
                                    fmlistinfo += ",";
                                }
                                fmlistinfo += (i + 1).toString();
                            }
                        }
                        CExeConfig.upall(onid,onnum,"开启",fmlistinfo,"","",
                                         "","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                Rectangle{
                    x:20*dp
                    y:100*dp
                    width: parent.width-40*dp
                    height: parent.height-100*dp
                    Image {
                        id: fmkg
                        source: "qrc:/picture/pz_fmpic1.png"
//                        fillMode: Image.PreserveAspectFit
                        width: parent.width
                        height: parent.height
                        Rectangle{
                            id:fmbt1
                            x:parent.width*0.085-36*dp
                            y:parent.height*0.48
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim1
                                anchors.fill: parent
                                source: fmlist[0]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v1.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[0]==="0"){
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[0]==="0"){
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[0]==="0"){
                                        fmlist[0]="1"
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[0]="0"
                                        fmbtim1.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt2
                            x:parent.width*0.1
                            y:parent.height*0.48
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim2
                                anchors.fill: parent
                                source: fmlist[1]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v2.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[1]==="0"){
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[1]==="0"){
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[1]==="0"){
                                        fmlist[1]="1"
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[1]="0"
                                        fmbtim2.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt3
                            x:parent.width*0.085-36*dp
                            y:parent.height*0.58
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim3
                                anchors.fill: parent
                                source: fmlist[2]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v3.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[2]==="0"){
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[2]==="0"){
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[2]==="0"){
                                        fmlist[2]="1"
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[2]="0"
                                        fmbtim3.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt4
                            x:parent.width*0.24-36*dp
                            y:parent.height*0.34
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim4
                                anchors.fill: parent
                                source: fmlist[3]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v4.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[3]==="0"){
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[3]==="0"){
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[3]==="0"){
                                        fmlist[3]="1"
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[3]="0"
                                        fmbtim4.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt5
                            x:parent.width*0.43-36*dp
                            y:parent.height*0.46
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim5
                                anchors.fill: parent
                                source: fmlist[4]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v5.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[4]==="0"){
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[4]==="0"){
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[4]==="0"){
                                        fmlist[4]="1"
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[4]="0"
                                        fmbtim5.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt6
                            x:parent.width*0.465
                            y:parent.height*0.38
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim6
                                anchors.fill: parent
                                source: fmlist[5]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v6.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[5]==="0"){
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[5]==="0"){
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[5]==="0"){
                                        fmlist[5]="1"
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[5]="0"
                                        fmbtim6.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt7
                            x:parent.width*0.545
                            y:parent.height*0.38
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim7
                                anchors.fill: parent
                                source: fmlist[6]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v7.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[6]==="0"){
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[6]==="0"){
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[6]==="0"){
                                        fmlist[6]="1"
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[6]="0"
                                        fmbtim7.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt8
                            x:parent.width*0.6-36*dp
                            y:parent.height*0.27
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim8
                                anchors.fill: parent
                                source: fmlist[7]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v8.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[7]==="0"){
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[7]==="0"){
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[7]==="0"){
                                        fmlist[7]="1"
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[7]="0"
                                        fmbtim8.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt9
                            x:parent.width*0.6
                            y:parent.height*0.5
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim9
                                anchors.fill: parent
                                source: fmlist[8]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v9.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[8]==="0"){
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[8]==="0"){
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[8]==="0"){
                                        fmlist[8]="1"
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[8]="0"
                                        fmbtim9.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt10
                            x:parent.width*0.724-18*dp
                            y:parent.height*0.2715
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim10
                                anchors.fill: parent
                                source: fmlist[9]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v10.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[9]==="0"){
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[9]==="0"){
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[9]==="0"){
                                        fmlist[9]="1"
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[9]="0"
                                        fmbtim10.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt11
                            x:parent.width*0.815-18*dp
                            y:parent.height*0.2715
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim11
                                anchors.fill: parent
                                source: fmlist[10]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v11.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[10]==="0"){
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[10]==="0"){
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[10]==="0"){
                                        fmlist[10]="1"
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[10]="0"
                                        fmbtim11.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt12
                            x:parent.width*0.87
                            y:parent.height*0.29
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim12
                                anchors.fill: parent
                                source: fmlist[11]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v12.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[11]==="0"){
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[11]==="0"){
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[11]==="0"){
                                        fmlist[11]="1"
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[11]="0"
                                        fmbtim12.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt13
                            x:parent.width*0.90+12*dp
                            y:parent.height*0.288
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim13
                                anchors.fill: parent
                                source: fmlist[12]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v13.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[12]==="0"){
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[12]==="0"){
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[12]==="0"){
                                        fmlist[12]="1"
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[12]="0"
                                        fmbtim13.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt14
                            x:parent.width*0.88
                            y:parent.height*0.43
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim14
                                anchors.fill: parent
                                source: fmlist[13]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v14.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[13]==="0"){
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[13]==="0"){
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[13]==="0"){
                                        fmlist[13]="1"
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[13]="0"
                                        fmbtim14.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                        Rectangle{
                            id:fmbt15
                            x:parent.width*0.91+12*dp
                            y:parent.height*0.4288
                            width: 36*dp
                            height: 26*dp
                            Image {
                                id:fmbtim15
                                anchors.fill: parent
                                source: fmlist[14]==="0"?"qrc:/picture/valveButton/bcg_r1.png":"qrc:/picture/valveButton/bcg_g1.png"
                            }
                            Image {
                                z:1
                                anchors.fill: parent
                                source: "qrc:/picture/valveButton/v15.png"
                            }
                            MouseArea{
                                anchors.fill: parent
                                hoverEnabled: true
                                cursorShape: Qt.PointingHandCursor
                                onEntered: {
                                    if(fmlist[14]==="0"){
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_r0.png"
                                    }else{
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_g0.png"
                                    }
                                }
                                onExited: {
                                    if(fmlist[14]==="0"){
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }else{
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }
                                }
                                onReleased: {
                                    if(fmlist[14]==="0"){
                                        fmlist[14]="1"
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_g1.png"
                                    }else{
                                        fmlist[14]="0"
                                        fmbtim15.source="qrc:/picture/valveButton/bcg_r1.png"
                                    }
                                    fmref()
                                }
                            }
                        }
                    }
                    Text {
                        //                        x:160*dp
                        y:parent.height-60*dp
                        height: 30*dp
                        id: fminfo
                        text: qsTr("阀门开数量:0             阀门关数量: 15")
                        width: parent.width*0.6
                        anchors.horizontalCenter: parent.horizontalCenter
                        horizontalAlignment: Text.AlignHCenter
                        font.pixelSize: config.fontsize + 3*dp
                        onWidthChanged: {
                            font.pixelSize = 12*dp + width *0.01
                        }
                    }
                }
            }
            Rectangle{
                id:zptab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("转盘")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-360*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "执行"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        if(zpwz.getText()===""){
                            toast.show("请确认参数是否填写完整",1)
                        }else{
                            CommunicationMethod.stepOperatingSimulation(3,[zpwz.getText(),zpsd.getText()])
                        }
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        zpwz.setText("1")
                        zpsd.setText("")
                    }
                }
                PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        if(zpwz.getText()===""){
                            toast.show("请确认参数是否填写完整",1)
                        }else{
                            CExeConfig.upall(onid,onnum,zpwz.getText(),zpsd.getText(),"","",
                                             "","","","","")
                            toast.show("保存成功", 0)
                        }
                    }
                }
                CustomComboBox{
                    id:zpwz
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'>*</font>转动位置")
                    model: ["1","2","3","4","5","6","7","8","9","10","11"]
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
                CustomInputText{
                    id:zpsd
                    x:parent.width/4*3-200*dp
                    y:100*dp
                    title: "转动速度"
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:ystab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("等待")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        yssc.setText("10")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,yssc.getText(),"","","","","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                CustomInputText{
                    id:yssc
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'></font>时长（s）")
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:jctab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("检测器")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        jctype.setText("")
                        jczt.setText("")
                        jclmd.setText("")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,jctype.getText(),jczt.getText(),jclmd.getText(),"","","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                Text {
                    x:parent.width/4-180*dp
                    y:108*dp
                    height: 40*dp
                    text: "阈值"
                    width: 140*dp
                    font.pixelSize: config.fontsize
                }
                CustomComboBox{
                    id:jctype
                    x:parent.width/4-30*dp
                    y:100*dp
                    height: 40*dp
                    model: ["大于","小于"]
                    editWidth: 120*dp
                    editDefaultText: "大于"
                }

                CustomInputText{
                    id:jczt
                    x:parent.width/4+100*dp
                    y:100*dp
                    height: 40*dp
                    editWidth: 120*dp
                }
                CustomInputText{
                    id:jclmd
                    x:parent.width/4*3-180*dp
                    y:100*dp
                    title: "灵敏度"
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:xhtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("循环")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        xhqsbh.setText("1")
                        xhzzbh.setText("2")
                        xhcs.setText("3")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,xhqsbh.getText(),xhzzbh.getText(),xhcs.getText(),"","","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                CustomInputText{
                    id:xhqsbh
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'></font>起始编号")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
                CustomInputText{
                    id:xhzzbh
                    x:parent.width/4*3-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'>*</font>终止编号")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
                CustomInputText{
                    id:xhcs
                    x:parent.width/4-200*dp
                    y:160*dp
                    title: qsTr("<font color='red'>*</font>循环次数")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:tgtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("跳过")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        tgbzs.setText("1")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,tgbzs.getText(),"","","","","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                CustomInputText{
                    id:tgbzs
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'></font>跳过步骤数")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                }
            }
            Rectangle{
                id:ggtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("盖盖")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-360*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "执行"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        CommunicationMethod.stepOperatingSimulation(8,[zpgg.getText()])
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        zpgg.setText("否")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,zpgg.getText(),"","","",
                                         "","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                CustomComboBox{
                    id:zpgg
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: qsTr("<font color='red'></font>盖盖")
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    model: ["是","否"]
                }
            }
            Rectangle{
                id:qbtab
                visible: false
                x:285*dp
                y:10*dp
                width: parent.width-295*dp
                height: parent.height-20*dp
                Rectangle{
                    x:20*dp
                    y:10*dp
                    Text {
                        text: qsTr("气泵")
                        font.bold: true
                        font.pixelSize: config.fontsize + 3*dp
                    }
                }
                PushButton{
                    x:parent.width-360*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "执行"
                    defaultMode1: true
                    onReleased: {
                        CommunicationMethod.stepOperatingSimulation(9,[qbkg.getText()])
                    }
                }
                PushButton{
                    x:parent.width-240*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "重置"
                    defaultMode2: true
                    radius: 4
                    onReleased: {
                        qbkg.setText("")
                    }
                }PushButton{
                    x:parent.width-120*dp
                    y:20*dp
                    width: 100*dp
                    height: 36*dp
                    title: "保存"
                    defaultMode1: true
                    onReleased: {
                        CExeConfig.upall(onid,onnum,qbkg.getText(),"","","",
                                         "","","","","")
                        toast.show("保存成功", 0)
                    }
                }
                CustomComboBox{
                    id:qbkg
                    x:parent.width/4-200*dp
                    y:100*dp
                    title: "气泵"
                    width: 400*dp
                    height: 40*dp
                    editWidth: 260*dp
                    titleWidth: 140*dp
                    model: ["开","关"]
                }
            }

        }
    }

}
